import Request from '@/utils/request'
import { Layer } from './types/mapConfig'

// 查询所有图层元素基本信息
export function queryAllLayer () {
  return Request<Array<Layer>>({
    url: '/mLayerElementConfig/queryAll',
    method: 'GET'
  })
}
// 更新图层
export function updateLayer (data:any) {
  return Request({
    url: '/mLayerElementConfig/update',
    method: 'PUT',
    data
  })
}

// 删除图层
export function deleteInfoById (id:string) {
  return Request({
    url: '/mLayerElementConfig/deleteById/' + id,
    method: 'DELETE'
  })
}

// 通过id查询图层详情信息
export function queryInfoById (id:string) {
  return Request<Layer>({
    url: '/mLayerElementConfig/findUintById/' + id,
    method: 'GET'
  })
}

// 新增图层数据
export function addLayer (data:any) {
  return Request({
    url: '/mLayerElementConfig/createUint',
    method: 'POST',
    data: data
  })
}

// 通过ID查询接口出参数据
export function findApiOutListById (id:any) {
  return Request({
    url: '/mLayerElementConfig/findApiOutListById/user/' + id,
    method: 'GET'
  })
}
